echo "Step 0：设置编译环境"
set PATH=C:\Qt\Qt5.12.4\5.12.4\msvc2017_64\bin;%PATH%
set PATH=C:\Qt\Qt5.12.4\Tools\QtCreator\bin;%PATH%
set output=bin

@rem 本机VS编译脚本目录
@set vcvar_bat="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
@rem 发布服务器VS编译环境
@rem set vcvar_bat=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat
@call %vcvar_bat% amd64


if exist %output% (
   echo 输出目录%output%已存在，无需创建
) else (
   md %output%
)

echo "Step 1：开始编译，输出到bin目录"

cd ./bin
@rem 清理bin目录
jom.exe clean
@rem 生成makefile文件
qmake.exe ../Zmq-Sample.pro -spec win32-msvc "CONFIG+=qtquickcompiler"
@rem 编译程序
jom.exe

echo "Step 2：加载程序所需的依赖文件"
cd release
windeployqt.exe Zmq-Sample.exe

@rem NSIS 打包
#cd ../../dist
#makensis  -DSOURCE_PATH="..\bin\release" -DPRODUCT_VERSION="1.0.0" "shell.nsi"

